﻿<div class="full_w">
	<div class="h_title">XEM ĐỀ THI</div>
    <div class="n_error"><?php echo $flash_error; ?></div>
	<div class="n_ok"><?php echo $flash_ok; ?></div>
	<?php echo form_open('managetest/mix'); ?>
	<h2><?php echo $test_name; ?></h2>
    <input type="hidden" id="test_id" name="test_id" value="<?php echo $test_id; ?>" />
    <p>
    	<div class="test-info">Thời gian: <span class="highlight"><?php echo $time; ?> phút</span></div>
        <div class="test-info">Số câu: <span class="highlight"><?php echo $num_question; ?></span></div>
        <div class="test-info">Thang điểm: <span class="highlight"><?php echo $max_score; ?></span></div>
        <div class="test-info">Tạo bởi <span class="highlight"><?php echo $created_user; ?></span> vào <span class="highlight"><?php echo $created_date; ?></span></div>
        <div class="clear"></div>
    </p>
    <p style="text-align:right">
    	<button type="submit" class="add">Đảo đề này</button>
        <a class="button" href="<?php echo site_url('tdc/test/edit/' . $test_id); ?>">Sửa</a>
        <a class="button" href="<?php echo site_url('managetest/delete/' . $test_id); ?>" onclick="return confirm('Bạn có chắc chắn muốn xóa đề thi này?')">Xóa</a>
    </p>
    <div class="sep"></div>
    <div class="test-content">
    	<?php $i = 1; foreach ($arr_question as $question) { ?>
    	
    		<p><b>Câu <?php echo $i++; ?>.</b></p><div class='ques-content'><?php echo $question['content']; ?></div>
            <div class="answer">
            	<div <?php if ($question['right_answer'] == '1') {echo 'class="right-ans"';} ?>><p class="f">A.</p> <?php echo $question['ans1']; ?><div class="clear"></div></div>
                
                <div <?php if ($question['right_answer'] == '2') {echo 'class="right-ans"';} ?>><p class="f">B.</p> <?php echo $question['ans2']; ?><div class="clear"></div></div>
                
                <div <?php if ($question['right_answer'] == '3') {echo 'class="right-ans"';} ?>><p class="f">C.</p> <?php echo $question['ans3']; ?><div class="clear"></div></div>
                
                <div <?php if ($question['right_answer'] == '4') {echo 'class="right-ans"';} ?>><p class="f">D.</p> <?php echo $question['ans4']; ?><div class="clear"></div></div>
                
            </div>
    	
        <div class="clear"></div>
        <div class="sep"></div>
        <?php } ?>
    </div>
    <p>
    	<button type="submit" class="add">Đảo đề này</button> 
        <a class="button" href="<?php echo site_url('tdc/test/edit/' . $test_id); ?>">Sửa</a>
        <a class="button" href="<?php echo site_url('managetest/delete/' . $test_id); ?>" onclick="return confirm('Bạn có chắc chắn muốn xóa đề thi này?')">Xóa</a>
    </p>
    </form>
</div>